package simple.alert.rule.condition;

public abstract class AbstractBaseCondition implements ICondition {

	protected BasicCondition basicCondition;
	protected long threshold;
	
	
	public AbstractBaseCondition(BasicCondition basicCondition, long threshold) {
		super();
		this.basicCondition = basicCondition;
		this.threshold = threshold;
	}

	@Override
	public boolean isMatch(long value) {
		return basicCondition.isMatch(value, threshold);
	}

	@Override
	public long getThreshold() {
		return this.threshold;
	}

	@Override
	public String getDesc() {
		return basicCondition.getDesc() + "'" + threshold + "'阈值时报警";
	}

}
